﻿
@functions{
    public MvcHtmlString GetSelectedMenuClass(OperatorMenu currentMenu, OperatorMenu selectedMenu)
    {        
        if (currentMenu == selectedMenu)
            return MvcHtmlString.Create(" class=\"active\"");

        return MvcHtmlString.Empty;
    }
    
    public MvcHtmlString GetSelectedMenuClass(AdminMenu currentMenu, AdminMenu selectedMenu)
    {
        if (currentMenu == selectedMenu)
            return MvcHtmlString.Create(" class=\"active\"");

        return MvcHtmlString.Empty;
    }
}


@if (SessionCache.CurrentUser != null)
{   
    <ul class="nav nav-list jb-sidenav affix jb-shadow jb-border-radius">
        @if (UserInfo.IsAdmin)
        {
            AdminMenu selectedMenu = AdminMenu.None;
            if (ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] != null)
            {
                selectedMenu = (AdminMenu)ViewData[AppConstants.ViewDataKeys.SELECTED_MENU];
            }
            <li@GetSelectedMenuClass(AdminMenu.Dashboard, selectedMenu)><a href="@Url.AdminUrl("dashboard", "account")"><i class="icon-chevron-right"></i> Dashboard</a></li>
            <li@GetSelectedMenuClass(AdminMenu.Import, selectedMenu)><a href="@Url.AdminUrl("Import", "FixedVehicle")"><i class="icon-chevron-right"></i> Import from BRTA</a></li>
            <li@GetSelectedMenuClass(AdminMenu.BackupDatabase, selectedMenu)><a href="@Url.AdminUrl("BackupDb", "Account")"><i class="icon-chevron-right"></i> Backup Database</a></li>
            <li@GetSelectedMenuClass(AdminMenu.EditVehicle, selectedMenu)><a href="@Url.PrivateUrl("Search", "Vehicle")"><i class="icon-chevron-right"></i> Edit Auto Rickshaw</a></li>
            <li@GetSelectedMenuClass(AdminMenu.EditTestResult, selectedMenu)><a href="@Url.PrivateUrl("Search", "TestResult")"><i class="icon-chevron-right"></i> Edit Data Sheet</a></li>
            <li@GetSelectedMenuClass(AdminMenu.ManageUser, selectedMenu)><a href="@Url.AdminUrl("List", "User")"><i class="icon-chevron-right"></i> Manage Users</a></li>
            @*<li@GetSelectedMenuClass(AdminMenu.ManageCategory, selectedMenu)><a href="@Url.AdminUrl("List", "Category")"><i class="icon-chevron-right"></i> Manage Categories</a></li>*@
            @*<li@GetSelectedMenuClass(AdminMenu.None, selectedMenu)><a href="@Url.AdminUrl("List", "IndustryType")"><i class="icon-chevron-right"></i> Manage Industry Types</a></li>*@
            @*<li@GetSelectedMenuClass(AdminMenu.ManagePackage, selectedMenu)><a href="@Url.AdminUrl("List", "Package")"><i class="icon-chevron-right"></i> Manage Packages</a></li>
            <li@GetSelectedMenuClass(AdminMenu.ManageContents, selectedMenu)><a href="@Url.AdminUrl("List", "Content")"><i class="icon-chevron-right"></i> Manage Contents</a></li>            
            <li@GetSelectedMenuClass(AdminMenu.SearchConfig, selectedMenu)><a href="@Url.AdminUrl("Index", "SearchConfig")"><i class="icon-chevron-right"></i> Manage Search</a></li>
            <li@GetSelectedMenuClass(AdminMenu.Settings, selectedMenu)><a href="@Url.AdminUrl("Index", "Settings")"><i class="icon-chevron-right"></i> Settings</a></li>*@
        }
        else if (UserInfo.IsOperator)
        {
            OperatorMenu selectedMenu = OperatorMenu.None;
            if (ViewData[AppConstants.ViewDataKeys.SELECTED_MENU] != null)
            {
                selectedMenu = (OperatorMenu)ViewData[AppConstants.ViewDataKeys.SELECTED_MENU];
            }     
            <li@GetSelectedMenuClass(OperatorMenu.Dashboard, selectedMenu)><a href="@Url.PrivateUrl("Dashboard", "Account")"><i class="icon-chevron-right"></i> Dashboard</a></li>
            <li@GetSelectedMenuClass(OperatorMenu.ChangePassword, selectedMenu)><a href="@Url.PrivateUrl("ChangePassword", "Account")"><i class="icon-chevron-right"></i> Change Password</a></li>
            @*<li@GetSelectedMenuClass(OperatorMenu.Search_Vehicles, selectedMenu)><a href="@Url.PrivateUrl("Search", "Vehicle")"><i class="icon-chevron-right"></i> Search Vehicles</a></li>*@
            @*<li@GetSelectedMenuClass(OperatorMenu.RegisterVehicle, selectedMenu)><a href="@Url.PrivateUrl("Edit", "Vehicle")"><i class="icon-chevron-right"></i> Auto Rickshaws</a></li>*@
            @*<li@GetSelectedMenuClass(OperatorMenu.EnterTestResult, selectedMenu)><a href="@Url.PrivateUrl("Search", "Vehicle")"><i class="icon-chevron-right"></i> Enter Test Result</a></li>*@
            <li@GetSelectedMenuClass(OperatorMenu.Vehicles, selectedMenu)><a href="@Url.PrivateUrl("Search", "Vehicle")"><i class="icon-chevron-right"></i> Auto Rickshaws</a></li>
            
            <li@GetSelectedMenuClass(OperatorMenu.TestResults, selectedMenu)><a href="@Url.PrivateUrl("Search", "TestResult")"><i class="icon-chevron-right"></i> Data Sheets</a></li>
            
            
            @*<li@GetSelectedMenuClass(OperatorMenu.InterviewRequests, selectedMenu)><a href="@Url.JobSeekerUrl("List", "InterviewRequest")"><i class="icon-chevron-right"></i> Interview Requests</a></li>*@
            @*<span class="badge badge-inverse pull-right">Black Badge</span>
            <span class="badge badge-info pull-right">Blueish Badge</span>*@
        }
    </ul>
}